//
//  MyMessageTableViewCell.m
//  Products_B
//
//  Created by lanou on 16/6/8.
//  Copyright © 2016年 朋学友. All rights reserved.
//

#import "MyMessageTableViewCell.h"

@interface MyMessageTableViewCell () {
    UIImageView *_header_img;
    UILabel *_nickLabel;
    UILabel *_messageLabel;
    UILabel *_timeLabel;
}

@end

@implementation MyMessageTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _header_img = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 30, 30)];
        _header_img.layer.cornerRadius = 15;
        _header_img.layer.masksToBounds = YES;
        _header_img.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_header_img];
        
        _nickLabel = [[UILabel alloc] initWithFrame:CGRectMake(_header_img.frame.origin.x + _header_img.frame.size.width + 10, 10, 80, 16)];
        _nickLabel.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_nickLabel];
        
        _messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(_header_img.frame.origin.x + _header_img.frame.size.width + 10, 30, 80, 14)];
        _messageLabel.backgroundColor = [UIColor greenColor];
        [self.contentView addSubview:_messageLabel];
        
        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kWidth - 10 - kWidth * 2 / 5, 15, kWidth * 2 / 5, 20)];
        _timeLabel.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_timeLabel];
    }
    return self;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
